package cn.yc.sgg.map_;

import org.junit.jupiter.api.Test;

import java.util.Collection;
import java.util.HashMap;
import java.util.Properties;
import java.util.Set;

public class Map_ {

    @Test
    public void map_bian_li(){
        HashMap map = new HashMap();
        map.put("1","A");
        map.put("2","B");
        map.put("3","C");

        // 所有的key
        Set set = map.keySet();
        for (Object key : set){
            System.out.println(key);
        }

        //所有value
        Collection values = map.values();
        for (Object value : values){
            System.out.println(value);
        }

        // 键值对的关系，EntrySet
        Set entrySet = map.entrySet();
        for (Object entry : entrySet){
            System.out.println(entry);
        }

        // Properties
        Properties properties = System.getProperties();
        System.out.println(properties);
    }
}
